﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.Objects;
using Persistency.DAL;
using System.Security.Permissions;
using SharedBusinessLogic.Security;

namespace SharedBusinessLogic.Models
{
	public class OrganisationModel
	{
		#region Construction

		public OrganisationModel()
		{

		}

		#endregion

		#region Methods

		//PrincipalPermission(SecurityAction.Demand, Role=TpPrincipal.EmployeeRoleName)]
		public void SaveOrganisation(OrganisationObject organisationObject)
		{
			OrganisatonDAL.SaveOrganisation(organisationObject);
		}

		public OrganisationObject GetOrganisation(int orgKey)
		{
			List<OrganisationObject> org = OrganisatonDAL.GetOrganisation(orgKey);
            org[0].AdressenListe = AdressDAL.GetOrganisationAdressen(org[0].OrgKey);
			return org[0];
		}
		
		#endregion
	}
}
